 {

        var o = require("./UISoundManager.js"), i = require("./UIPopupBase.js");
        cc.Class({
            extends: i,
            properties: {
                goldNum: {
                    default: null,
                    type: cc.Label
                },
                buy: {
                    default: null,
                    type: cc.Label
                },
                _hadDiamond: 0,
                _needDiamond: 0,
                _roomId: 0,
                _tableId: 0,
                _buyType: null,
                sp: cc.Sprite,
                spfArr: [cc.SpriteFrame],
                diamondIcon: cc.Node,
                rmbIcon: cc.Node,
                normalRechargeNode: cc.Node,
                firstRechargeNode: cc.Node
            },
            init: function () {
            },
            bindData: function (e, t) {
                if (console.log("bindData data:", e), this.type = t || 0, 3 == this.type) return this.produceId = "TY9999D0006069",
                    this.isEnoughYuanbao = !1, this.normalRechargeNode.active = !1, void (this.firstRechargeNode.active = !0);
                this._hadDiamond = e.hadYuanBao, this._needDiamond = e.needYuanBao, this._roomId = e.roomId,
                    this._tableId = e.tableId, this._buyType = e.buyType, this.produceId = e.buyProductId || e.yuanBaoProduceId,
                    this.isEnoughYuanbao = !1, this.isFoundInConfig = !1, this._hadDiamond >= this._needDiamond ? this.isEnoughYuanbao = !0 : this.isEnoughYuanbao = !1;
                var n = Global.configCdn.getShopIdsConf() || Global.configCdn.getDefaultConfig("shopIds");
                for (var o in n) if (o == this.produceId) {
                    var i = n[o];
                    this.isFoundInConfig = !0;
                    break;
                }
                this.refresh(i, e);
            },
            refresh: function (e, t) {
                this.isEnoughYuanbao ? (this.buy.string = this._needDiamond, this.goldNum.string = "金币x" + Global.utils.exchangeToWan(t.buyCoin),
                    this.diamondIcon.active = !0, this.rmbIcon.active = !1) : (this.isFoundInConfig ? (this.buy.string = e.price,
                    this.goldNum.string = "金币x" + Global.utils.exchangeToWan(t.buyCoin)) : (this.resetData(),
                    this.buy.string = "6", this.goldNum.string = "金币x6万"), this.diamondIcon.active = !1,
                    this.rmbIcon.active = !0), this.sp && this.spfArr[this.type] && (this.sp.spriteFrame = this.spfArr[this.type]);
            },
            resetData: function () {
                this.produceId = "TY9999D0002020";
            },
            onBtnCharge: function () {
                if (o.playEffect("select"), this.isEnoughYuanbao) {
                    var e;
                    e = {
                        roomId: this._roomId,
                        tableId: this._tableId,
                        buyType: this._buyType
                    };
                    var t = Global.eventName.CMD_COIN_BUY;
                    Global.msgHandler.requestBuyCoin(t, e.roomId, e.tableId, e.buyType);
                } else {
                    var n = Global.configCdn.getShopIdsConf() || Global.configCdn.getDefaultConfig("shopIds");
                    this.showCommonCharge(n), this.closePanel();
                }
            },
            showCommonCharge: function (e) {
                var t = {
                    prodPrice: 0,
                    desc: "",
                    prodId: "",
                    prodName: "",
                    buyType: ""
                };
                for (var n in e) if (n == this.produceId) {
                    t.prodPrice = e[n].price, t.desc = e[n].desc, t.prodId = e[n].productId, t.prodName = e[n].displayName,
                        t.buyType = this._buyType;
                    break;
                }
                Global.SDK.recharge(t);
            },
            OnPanelClose: function () {
                o.playEffect("select");
                var e = Global.tableModel.getPlayerModel(Global.config.SEAT_DOWN);
                e && Global.tableModel.requestCharge(-1, e.getSeatId()), this.closePanel();
            }
        })
    }